package com.hanserwei.community.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 系统菜单表
 */
@Schema(description = "系统菜单表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_menu")
public class Menu implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID，主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "菜单ID，主键")
    private Integer id;

    /**
     * 父级菜单ID，0表示顶级菜单
     */
    @TableField(value = "pid")
    @Schema(description = "父级菜单ID，0表示顶级菜单")
    private Integer pid;

    /**
     * 菜单名称
     */
    @TableField(value = "`name`")
    @Schema(description = "菜单名称")
    private String name;

    /**
     * 菜单图标（Element UI图标名）
     */
    @TableField(value = "icon")
    @Schema(description = "菜单图标（Element UI图标名）")
    private String icon;

    /**
     * 前端路由地址
     */
    @TableField(value = "route")
    @Schema(description = "前端路由地址")
    private String route;

    /**
     * 菜单排序号
     */
    @TableField(value = "sort_id")
    @Schema(description = "菜单排序号")
    private Integer sortId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
}